<?php
/**
 * Created by PhpStorm.
 * User: http
 * Date: 2018/7/13
 * Time: 15:36
 */

namespace Document\Model\Carousel\Home;


class GetIntroduceCarouselModel
{

    private $model;
    private $documentModel;

    public function __construct()
    {
        $this->model = new \Document\Model\Carousel\DocumentIntroduceModel();
        $this->documentModel = $this->model->getDocumentModel();
    }

    public function get()
    {
        $select = [ 'title', 'cover_id' ];
        $where = [
            'category_id' => $this->model->getCategoryId(),
			'model_id' => $this->model->getModelId(),
            'display' => 1
        ];
		
        return $this->documentModel->field( $select )->where( $where )->order('id desc')->limit(1) ->select();
    }

}